/**
 * smcf.h
 **/
#ifndef __SMCF_H__
#define __SMCF_H__

#define MODULE_ID_LM	0

typedef struct __module {
	int id;						/* module id */
	char *name;				/* module name */
	/* message process handler, the newer message can't be processed before
	 * current process finished, so don't blocked in this function */
	int (*msg_process)(int sender_id, int msgid, void *data);
} module_t;

int smcf_init(int (*lm_msg_process)(int sender_id, int msgid, void *data));
int smcf_start(void);
void smcf_stop(void);
int smcf_module_register(module_t *module);

/**
 * the highest priority
 **/
#define MSG_PRI_REALTIME	0
#define MSG_PRI_HIGH		1
#define MSG_PRI_MIDDLE		2
#define MSG_PRI_LOW	        3

#define MSG_TYPE_ASYNC		0
#define MSG_TYPE_SYNC		1

int send_msg(int sender_id, int receiver_id, int msgpri, int sync,
	     int msgid, void *data, void (*data_free)(void *data));

#endif /* __SMCF_H__ */
